<?php
//检查用户是否全部填写
function filled_out($form_vars)
{
    foreach ($form_vars as $key => $value) {
        if ((!isset($key)) || ($value == '')) {
            return false;
        }
    }
    return true;
}
//检查邮箱格式
function valid_email($address)
{
    $pregEmail = "/([a-z0-9]*[-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?/i";

    return preg_match($pregEmail, $address);
}
?>